<?php

namespace App\Http\Controllers\Web;

use App\Http\Controllers\Controller;

class BaseController extends Controller
{
    public function success($data = [], $msg = '', $code = 200)
    {
        return response()->json(['code' => $code, 'message' => $msg, 'data' => $data]);
    }

    public function fail($msg = '', $code = -200, $data = [])
    {
        return response()->json(['code' => $code, 'message' => $msg, 'data' => $data]);
    }
}
